/*
 * This file is part of the Try! Engine project.
 *
 * Copyright 2010-2011 Emanuele Bertoldi. All rights reserved.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * You should have received a copy of the modified BSD License along with this
 * program. If not, see <http://www.opensource.org/licenses/bsd-license.php>
 */

#ifndef TRY_GRAPHICS_H
#define TRY_GRAPHICS_H

#include <transformable.h>
#include <try.h>
#include <Horde3D.h>

namespace Try
{
    typedef H3DNode NodeHandle;
    typedef H3DRes ResourceHandle;

    struct Color
    {
        float r, g, b, a;

        Color(float r = 1, float g = 1, float b = 1, float a = 1)
            : r(r), g(g), b(b), a(a) {}
    };

    namespace Colors
    {
        const Color White = Color(1, 1, 1);
        const Color Black = Color(0, 0, 0);
        const Color Gray = Color(0.5, 0.5, 0.5);
        const Color Red = Color(1, 0, 0);
        const Color Green = Color(0, 1, 0);
        const Color Blue = Color(0, 0, 1);
        const Color Yellow = Color(1, 1, 0);
        const Color Purple = Color(1, 0, 1);
    }

    class SceneNode;
    class CameraNode;
    class RenderContext;

    class SceneNodeListener
    {
    public:
        virtual void onTransformChanged(SceneNode* n, const Transform& t) {}
        virtual void onParentChanged(SceneNode* n, SceneNode* p) {}
        virtual void onDeleting(SceneNode* n) {}
    };

    class CameraNodeListener
    {
    public:
        virtual void onViewportChanged(CameraNode* c, int width, int height, float fov, float near_clip, float far_clip) {}
    };

    class RenderListener
    {
    public:
        virtual void onRenderStarted(double dt) {}
        virtual void onRenderStarted(RenderContext* rc, double dt) {}
        virtual void onRenderEnded(RenderContext* rc) {}
        virtual void onRenderEnded() {}
    };

    class RenderContextListener
    {
    public:
        virtual void onContextUpdated(RenderContext* rc) {}
        virtual void onCameraChanged(RenderContext* rc, CameraNode* cam) {}
    };

    class RenderWindowListener
    {
    public:
        virtual void onWindowResized(int width, int height) {}
        virtual void onWindowClosed(int ret_code) {}
    };
}

#endif // TRY_GRAPHICS_H
